﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class Customer
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name = string.Empty;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _nr = string.Empty;
        [DataMember]
        public string Nr
        {
            get { return _nr; }
            set { _nr = value; }
        }

        private string _address = string.Empty;
        [DataMember]
        public string Address
        {
            get { return _address; }
            set { _address = value; }
        }

        private string _contactPerson1 = string.Empty;
        [DataMember]
        public string ContactPerson1
        {
            get { return _contactPerson1; }
            set { _contactPerson1 = value; }
        }

        private string _contactPerson1Tel = string.Empty;
        [DataMember]
        public string ContactPerson1Tel
        {
            get { return _contactPerson1Tel; }
            set { _contactPerson1Tel = value; }
        }

        private string _contactPerson1Phone1 = string.Empty;
        [DataMember]
        public string ContactPerson1Phone1
        {
            get { return _contactPerson1Phone1; }
            set { _contactPerson1Phone1 = value; }
        }

        private string _contactPerson1Phone2 = string.Empty;
        [DataMember]
        public string ContactPerson1Phone2
        {
            get { return _contactPerson1Phone2; }
            set { _contactPerson1Phone2 = value; }
        }

        private string _contactPerson2 = string.Empty;
        [DataMember]
        public string ContactPerson2
        {
            get { return _contactPerson2; }
            set { _contactPerson2 = value; }
        }

        private string _contactPerson2Tel = string.Empty;
        [DataMember]
        public string ContactPerson2Tel
        {
            get { return _contactPerson2Tel; }
            set { _contactPerson2Tel = value; }
        }

        private string _contactPerson2Phone1 = string.Empty;
        [DataMember]
        public string ContactPerson2Phone1
        {
            get { return _contactPerson2Phone1; }
            set { _contactPerson2Phone1 = value; }
        }

        private string _contactPerson2Phone2 = string.Empty;
        [DataMember]
        public string ContactPerson2Phone2
        {
            get { return _contactPerson2Phone2; }
            set { _contactPerson2Phone2 = value; }
        }

        private string _financialAffairs = string.Empty;
        [DataMember]
        public string FinancialAffairs
        {
            get { return _financialAffairs; }
            set { _financialAffairs = value; }
        }

        private string _financialAffairsTel = string.Empty;
        [DataMember]
        public string FinancialAffairsTel
        {
            get { return _financialAffairsTel; }
            set { _financialAffairsTel = value; }
        }

        private string _financialAffairsPhone1 = string.Empty;
        [DataMember]
        public string FinancialAffairsPhone1
        {
            get { return _financialAffairsPhone1; }
            set { _financialAffairsPhone1 = value; }
        }

        private string _financialAffairsPhone2 = string.Empty;
        [DataMember]
        public string FinancialAffairsPhone2
        {
            get { return _financialAffairsPhone2; }
            set { _financialAffairsPhone2 = value; }
        }

        private string _fax = string.Empty;
        [DataMember]
        public string Fax
        {
            get { return _fax; }
            set { _fax = value; }
        }

        private string _remark = string.Empty;
        [DataMember]
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        private decimal _intergral;
        [DataMember]
        public decimal Intergral
        {
            get { return _intergral; }
            set { _intergral = value; }
        }

        private decimal _amount;
        [DataMember]
        public decimal Amount
        {
            get { return _amount; }
            set { _amount = value; }
        }


        private decimal _flightIntergralRate;
        [DataMember]
        public decimal FlightIntergralRate
        {
            get { return _flightIntergralRate; }
            set { _flightIntergralRate = value; }
        }

        private User _salesman;
        [DataMember]
        public User Salesman
        {
            get { return _salesman; }
            set { _salesman = value; }
        }

        private WebUser _webUser;
        [DataMember]
        public WebUser WebUser
        {
            get { return _webUser; }
            set { _webUser = value; }
        }

        private decimal? _hotelIntergralRate;
        [DataMember]
        public decimal? HotelIntergralRate
        {
            get { return _hotelIntergralRate; }
            set { _hotelIntergralRate = value; }
        }

        private List<CustomerHotelIntergralRate> _hotelIntergralList = new List<CustomerHotelIntergralRate>();
        [DataMember]
        public List<CustomerHotelIntergralRate> HotelIntergralList
        {
            get { return _hotelIntergralList; }
            set { _hotelIntergralList = value; }
        }

        private List<IntergralExchange> _intergralExchangeHistory = new List<IntergralExchange>();
        [DataMember]
        public List<IntergralExchange> IntergralExchangeHistory
        {
            get { return _intergralExchangeHistory; }
            set { _intergralExchangeHistory = value; }
        }

        private List<Passenger> _passengerList = new List<Passenger>();
        [DataMember]
        public List<Passenger> PassengerList
        {
            get { return _passengerList; }
            set { _passengerList = value; }
        }

        public override string ToString()
        {
            return Name;
        }

        public override bool Equals(object obj)
        {
            Customer temp = obj as Customer;
            if (temp == null)
                return false;
            return (this.ID.Equals(temp.ID));
        }
    }
}
